const a = async function (e, d, { dc: { http, store }, dayjs }) {
  const now = dayjs();
  const year = now.year();
  const yearStore = Number(dayjs(store.get("user", "date")).format("YYYY"));
  const dataInfo = await http.form({
    url: "/nyk/search/getHomeInfo",
    data: { id: 3, year: yearStore },
  });
  const ret = JSON.parse(dataInfo);
  if (yearStore !== year) {
    ret.SXX = 100;
  } else {
    const isLeapYear = (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
    const startOfYear = dayjs().startOf("year");
    const dayOfYear = now.diff(startOfYear, "day") + 1;
    const totalDays = isLeapYear ? 366 : 365;
    const timeliness = ((dayOfYear / totalDays) * 100).toFixed(2);
    ret.SXX = timeliness;
  }

  return { items: [ret] };
};
